import {createApp} from 'vue'
import App from './App.vue'
import router from "./router";
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/utils/date-format'
import bus from "@/lib/bus";
import {store} from "@/store"
import './router/beforeEach'
import '@/index.css'
//自定义组件
// import zui from '@/lib/zui.umd.min.js'

const app = createApp(App)
app.use(ElementPlus)
app.use(router)
app.use(store)
// app.use(zui)

app.config.globalProperties.$bus = bus

//自定义指令
//全局自定义指令
app.directive('permission', {
    mounted(el, binding) {
        let permission = binding.value
        const permissions = store.state.account.permissions
        if (permissions.indexOf(permission) !== -1) {
            el.style = "display:none";
        }
    }
})

//挂载事务总线为全局属性
app.mount('#app')
